<template>
  <div class="box">
    <header class="header">
      <div class="left">
        <router-link to="/autocomplete1" tag="span">
          <span class="iconfont icon-jiantou21"></span>
        </router-link>
      </div>
      <div class="middle">个人中心</div>
      <div class="right"></div>
    </header>
    <div class="content">
      <mt-actionsheet :actions="actions" v-model="sheetVisible" style="color:0.18rem;line-height:0.45rem;"></mt-actionsheet>
      <ul class="me_update">
        <li>
          <span>头像</span>
          <p><span><img src="https://ps.ssl.qhimg.com/t012aaa61b026c6fb20.jpg" @click="getPhoto"></span><i></i></p>
        </li>
        <li><span>昵称</span>
          <router-link to="/update1" tag="p">
            <p>
              <span class="update">大王</span><i class="iconfont icon-arrow-right-copy-copy-copy"></i>
            </p>
          </router-link>
        </li>
        <li><span>性别</span>
          <p>
            <span>{{ list.gender }}</span><i class="iconfont icon-arrow-right-copy-copy-copy"></i>
          </p>
        </li>
        <li><span>当前身份</span>
          <router-link to="/update2" tag="p">
            <p><span>{{ list.currentstatus }}</span><i class="iconfont icon-arrow-right-copy-copy-copy"></i></p>
          </router-link>
        </li>
        <li><span>所在地区</span>
          <p @click="getCity">
            <span>{{ area }}</span>
            <i class="iconfont icon-arrow-right-copy-copy-copy"></i>
          </p>
        </li>
        <li><span>感兴趣的行业</span>
          <router-link to="/update4" tag="p">
            <p><span>{{ list.strinterestedindustry }}</span><i class="iconfont icon-arrow-right-copy-copy-copy"></i></p>
          </router-link>
        </li>
        <li><span>感兴趣的职业</span>
          <router-link to="/update5" tag="p">
            <p><span>{{ list.strinterestedprofession }}</span><i class="iconfont icon-arrow-right-copy-copy-copy"></i></p>
          </router-link>
        </li>
        <li><span>自我介绍</span>
          <router-link to="/update6" tag="p">
            <p><span>{{ list.selfintroduction }}</span><i class="iconfont icon-arrow-right-copy-copy-copy"></i></p>
          </router-link>
        </li>
        <li><span>个人资料</span>
          <router-link to="/update7" tag="p">
            <p><span></span><i class="iconfont icon-arrow-right-copy-copy-copy"></i></p>
          </router-link>
        </li>
      </ul>
      <div class="experience">
        <p>
          <router-link to="/update8" tag="i">
            <i class="iconfont icon-jiahao3"></i>
          </router-link>
          <span>添加工作经历</span>
        </p>
        <p>
          <router-link to="/update9" tag="i" class="iconfont icon-jiahao3">
          </router-link>
          <span>添加教育经历</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import {
  Actionsheet
} from 'mint-ui'
Vue.use(Actionsheet)
export default {
  data () {
    return {
      list: [],
      // area: sessionStorage.getItem('city') ? sessionStorage.getItem('city') : '请选择',
      area: sessionStorage.getItem('city'),
      actions: [{
        name: '拍照',
        method: this.takephoto1
      }, {
        name: '相册选取',
        method: this.takephoto2
      }],
      sheetVisible: false
    }
  },
  // created () {
  //   fetch('http://10.8.162.38:8080/selectUserAllById?id=1').then(res => res.json())
  //     .then(data => {
  //       console.log(data.data)
  //       this.list = data.data
  //       console.log(this.list)
  //     })
  // },
  methods: {
    getCity () {
      sessionStorage.setItem('city1', this.area)
      this.$router.push({
        path: '/update3'
      })
    },
    getPhoto () {
      this.sheetVisible = !this.sheetVisible
    },
    takephoto1 () {
      console.log('拍照')
    },
    takephoto2 () {
      console.log('相册选取')
      this.$router.push({
        path: '/update0'
      })
    },
    logout () {
      localStorage.removeItem('isLogin')
      this.$router.push('/user')
    }
  }
}
</script>

<style lang="scss" scoped>
  @import '@/lib/reset.scss';

  .header {
    .icon-jiantou21 {
      color: #fff;
      font-size: 0.2rem;
    }

    .middle {
      color: #fff;
    }
  }

  .me_update {
    li {
      padding: 0rem 0.2rem;
      display: flex;
      line-height: 0.7rem;
      color: #333;
      justify-content: space-between;
      border-bottom: 1px solid #ccc;
      p {
        line-height: 0.7rem;
        display: flex;
        .update {
          display: inline-block;
          margin-right: 0.05rem;
        }
      }

      img {
        display: inline-block;
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        background: rgb(86, 165, 230);
      }
    }
  }
  .experience {
    display: flex;
    justify-content: space-around;
    background: #ccc;
    height: 0.5rem;
    width: 100%;
    line-height: 0.5rem;
    position: fixed;
    bottom: 0;
    p{
      i{
        padding:0.05rem;
        font-size:0.18rem;
      }
    }
  }
</style>
